<?php
namespace App\Models;

use Illuminate\Database\Eloquent\Builder;

class Config extends CommonModel {
	
	protected static function boot()
	{
		parent::boot();
		
		static::addGlobalScope('status', function(Builder $builder) {
			$builder->where('status', '=', 1);
		});
	}
	/**
	 * @param $query
	 * @param $key
	 * @return mixed
	 */
	public function scopeKey($query,$key){
		$query->where(['key'=>$key]);
	}
}